#include<Servo.h>

Servo myservo1;

char intByte =0;
int angle=0;
String temp="";


void setup() {
  // put your setup code here, to run once:
  myservo1.attach(11);
  Serial.begin(9600);
  
}

void loop() {
  // put your main code here, to run repeatedly:
  while(Serial.available()>0){
    intByte=Serial.read();
    temp+=intByte;
  }
  if(temp!=""){
    angle = temp.toInt();
    Serial.println(angle);
    
  }
  temp="";
  myservo1.write(angle);
  delay(100);
}
